<?php if(!defined('ARCH_ROOT_PATH')) exit;
/**
 *	Architect Framework
 *
 *	Architect Framework is a light weight object oriented web applications framework written for PHP 5.1.4 and later that provide the tools to develop and deploy a website or application fast and with as little code as possible.
 *
 *	@author Robin Grass, <hello@coffinboy.se>
 *	@link http://architect.kodlabbet.net
 *	@license http://www.opensource.org/licenses/gpl-3.0.html GNU General Public License (v. 3)
 */

/**
 *	Architect_ViewLoader
 *
 *	This class is used for faster view loading.
 *
 *	@package Utilities
 *	@version 1.0
 *	@author Robin Grass, <hello@coffinboy.se>
 */
class Architect_ViewLoader {

	/**
	 *	load
	 *
	 *	@param string $template
	 *	@param array $variables
	 */
	public static function load($template, $variables = null) {
		if(is_array($variables)) {
			$tpl = new Artchitect_Template();
			$tpl->setTemplate($template . ARCH_FILE_EXT);
			$tpl->setVariables($variables);
		echo $tpl->render();
		} else {
			af_load(ARCH_VIEWS_PATH . $template . ARCH_FILE_EXT);
		}
	}

}
?>